<template>
	<view>
		<view class="flex flex-column align-center justify-between py-5 my-3">
			<text class="iconfont icon-iconfontxuanzhong text-main" style="font-size: 100rpx;"></text>
			<text class="text-dark font-lg">支付成功</text>
			<view class="px-5 w-100 mt-3">
				<view @click="goToOrderDetailPage()" class="main-bg-color text-white font-md w-100 py-2 rounded mt-3 text-center" hover-class="main-bg-hover-color">查看订单</view>
				<view @click="goToHome('index')" class="border font-md w-100 py-2 rounded mt-3 text-center" hover-class="bg-light">返回首页</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref, reactive } from "vue";
	import { onLoad, onShow } from "@dcloudio/uni-app";
	
	const orderCode = ref("")
	
	onLoad((e)=>{
		console.log("支付结果页",e.data);
		if(!e.data){
			uni.navigateBack()
		}
		orderCode.value = e.data
	})
	
	const goToOrderDetailPage = () => {
		uni.navigateTo({
			url:"/pages/orderDetail/orderDetail?data="+orderCode.value
		})
	}
	
	const goToHome = (pageName) => {
		uni.switchTab({
			url:"/pages/index/index"
		})
	}
</script>

<style>

</style>
